home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / powervww / pvbasics.cpp < prev    next >
C/C++ Source or Header  |  1998-01-05  |  2KB  |  73 lines

  1. //  ____________________________________________________
  2. // |                                                    |
  3. // |  Project:     POWER VIEW INTERFACE                 |
  4. // |  File:        PVBASICS.CPP                         |
  5. // |  Compiler:    WPP386 (10.6)                        |
  6. // |                                                    |
  7. // |  Subject:     Basic and common-use stuff           |
  8. // |                                                    |
  9. // |  Author:      Emil Dotchevski                      |
  10. // |____________________________________________________|
  11. //
  12. // E-mail: zajo@geocities.com
  13. // URL:    http://www.geocities.com/SiliconValley/Bay/3577
  14.  
  15. #define uses_string
  16. #define uses_basics
  17.  
  18. #include "PVuses.h"
  19.  
  20. //SET PROCESSING
  21.  
  22. void Tset::operator ~ ( void )
  23. {
  24.   for( int i = 0; i < 32; i++ )
  25.     members[i] = 0;
  26. }
  27.  
  28. void Tset::operator ! ( void )
  29. {
  30.   for( int i = 0; i < 32; i++ )
  31.     members[i] = 0xFF;
  32. }
  33.  
  34. int Tset::is_empty( void )
  35. {
  36.   for( int i = 0; i < 32; i++ )
  37.     if( members[i] ) return 0;
  38.   return 1;
  39. }
  40.  
  41. Tset& operator << ( Tset &set, Tset &set1 )
  42. {
  43.   for( int i = 0; i < 32; i++ )
  44.     set.members[i] |= set1.members[i];
  45.   return set;
  46. }
  47.  
  48. Tset& operator >> ( Tset &set, Tset &set1 )
  49. {
  50.   for( int i = 0; i < 32; i++ )
  51.     set.members[i] &= ~set1.members[i];
  52.   return set;
  53. }
  54.  
  55. int operator == ( Tset &set1, Tset &set2 )
  56. {
  57.   for( int i = 0; i < 32; i++ )
  58.     if( set1.members[i] != set2.members[i] ) return 0;
  59.   return 1;
  60. }
  61.  
  62. //TEXT PROCESSING
  63.  
  64. void cyr_strupr( char *str )
  65. {
  66.   for( char *c=str; *c; *c=cyr_toupper(*c),c++ );
  67. }
  68.  
  69. void cyr_strlwr( char *str )
  70. {
  71.   for( char *c=str; *c; *c=cyr_tolower(*c),c++ );
  72. }
  73.